import ConvexGeometry from "./convex-geometry";
import Vec3 from "../common/vec3";
import CONSTANT from "../constant";

export default class AabbGeometry extends ConvexGeometry{
    constructor() {
        super(CONSTANT.GEOMETRY_TYPE_NULL);
        this.min = new Vec3();
        this.max = new Vec3();
    }
    computeLocalSupportingVertex(dir,out) {
        let oe=out.elements, de=dir.elements, ae=this.max.elements,ie=this.min.elements;
        oe[0] = de[0] > 0 ? ae[0] : ie[0];
        oe[1] = de[1] > 0 ? ae[1] : ie[1];
        oe[2] = de[2] > 0 ? ae[2] : ie[2];
    }
}